This application claims the priority benefit of Taiwan application Ser. No. 89122783, filed Oct. 30, 2000.
1. Field of the Invention
The invention relates in general to a function generator with an adjustable oscillating frequency. More particularly, this invention relates to a function generator with an oscillating frequency, which can be adjusted independent of an external voltage source.
2. Description of the Related Art
Many computer accessories such as the mouse require low fabrication cost and low power consumption. These kinds of products are typical circuit design of CMOS devices. If an external quartz oscillator is used by the conventional method, drawbacks as follows occur. First, the fabrication cost is increased. Second, the design has to compromise the frequency specification of the quartz oscillator. Third, as shown in FIG. 1, the CMOS inverter used as a Pierce-type transistor oscillator of the amplifier includes a PMOS (MP), an NMOS (MN), a resistor Rf, and two capacitors C1 and C2. The CMOS inverter is connected to an operation voltage VDD As the capacitance of the capacitors C1 and C2 is sufficiently large, a large current is required while the oscillator is operating. To reduce the gain of the CMOS inverter for saving power, the frequency output of the oscillator will be stabilized through a long period of time, or even incorrect or incapable of oscillating.
The invention provides a function generator with an adjustable oscillation frequency that can be integrated in a CMOS circuit design with other digital circuits. Therefore, the function generator can be fabricated with a low cost and power consumption.
The function generator with an adjustable oscillating frequency is operated under an operation voltage (VDD). The function generator comprises a first comparator, a second comparator, a latch circuit, a capacitor, a first current source and a second current source.
The reference voltage of the first comparator is referred as the first reference voltage and the reference voltage of the second comparator is referred as the second reference voltage. The first reference voltage is larger than the second reference voltage. The latch circuit comprises a first input terminal, a second input terminal, a first output terminal and a second output terminal. The first and second input terminals are coupled to the output terminals of the first and the second comparators, respectively. Being latched by the latch circuit, the outputs of the first and second comparators are then output from the first and the second output terminals. The capacitor has one terminal grounded, and has a voltage level of the other terminal as a comparing voltage. The first and second current sources charge and discharge the capacitor unit via a first and a second switches. The voltage level of the first output terminal of the latch circuit controls the first switch, while the voltage level of the second output terminal of the latch circuit controls the second switch. When the comparing voltage is smaller than the second reference voltage, the voltage level at the first output terminal is at a high potential (the first output terminal is said to be xe2x80x9cHighxe2x80x9d), and the voltage level at the second output terminal is at a low potential (the second output terminal is said to be xe2x80x9cLowxe2x80x9d). When the comparing voltage is larger than the second reference voltage but smaller than the first reference voltage, the voltage level at the first and second output terminals are still maintained. When the comparing voltage is larger than the first reference voltage, the voltage level at the first output terminal is at a low potential (xe2x80x9cLowxe2x80x9d), and the voltage level at the second output terminal is at a high potential (xe2x80x9cHigh).
In the above structure, the current magnitudes of the first and the second current sources are proportional with the operation voltage, and the current magnitudes for the first and second current sources can be the same.
The above function generator further comprises a bias circuit including several series-connected resistors, an adjustable resistor, a first transistor and a second transistor. The series-connected resistors have a first end coupled to the operation voltage, and the other end grounded. The first transistor includes a first gate, a first source and a first drain. The second transistor includes a second gate, a second source and a second drain. The first gate is coupled to a potential dividing point in the series-connected resistors that divides the operation voltage. The first source is coupled to a second gate and a second drain of the second transistor, and the first drain is coupled to an adjustable resistor. The second source of the second transistor is coupled to the operation voltage. Thereby, the current of the adjustable resistor is provided to the first and the second current sources.
In addition, the function generator further comprises an operation amplifier. The operation amplifier comprises a positive input terminal, a negative input terminal and an third output terminal. The positive input terminal is coupled to the potential dividing point, the negative input terminal is coupled to the first source of the first transistor that is coupled to the adjustable resistor, and the third output terminal is coupled to the first gate of the first transistor.
As mentioned above, the potentials of the first and second output terminals of the first and the second comparators are determined by the comparing voltage, the first and the second reference voltages. The potentials of the first and the second terminals of the latch circuit can then control the charge and discharge operations of the capacitor. The first output terminal is High and the second output terminal is Low, the capacitor is charged by the first current source. When the second output terminal is High and the first output terminal is Low, the capacitor is discharged by the second current source. According to the charging and discharging time of the capacitor, the output signal of the oscillation frequency can be determined. According to the current for charging and discharging the capacitor, the oscillation frequency of the function generator can be adjusted.
Both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.